import { ParamsPage, ResponsePage } from '@/api/common/type';

export type WorkingCalendarParams = ParamsPage & SearchParams;

export interface SearchParams {
    mouth?: string;
    deviceCode?: number;
}

export interface WorkingCalendarResponse {
    headers: WorkingCalendarHeaders[];
    calendarPage: CalendarPage;
}

export interface WorkingCalendarHeaders {
    date: string;
    day: number;
    week: number;
}

export interface CalendarPage extends ResponsePage {
    records: CalendarPageRecords[];
}

export interface CalendarPageRecords {
    deviceId: number;
    deviceCode: string;
    calendars: {
        [key: string]: AdditionalProp;
    };
}

export interface AdditionalProp {
    id: number;
    isEdit: boolean;
    periodId: number;
    periodInfo: PeriodInfo;
    start?: boolean;
    end?: boolean;
    center?: boolean;
}
export interface PeriodInfo {
    name: string;
    tipName?: string;
    times: {
        start: string;
        end: string;
    }[];
}
